package entity

import (
	"context"
	"fmt"

	opaquex "origin/model/opaquex"

	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

type ApiOpaque struct {
	opaquex.UnimplementedAuthServicexServer
}

func (a *ApiOpaque) Single(ctx context.Context, rq *opaquex.LoginRequest) (*opaquex.LoginResponse, error) {
	fmt.Println("receive", rq.String())
	responsex := opaquex.LoginResponse{}
	responsex.SetAccessToken("token")
	responsex.SetExpiresIn(1024)
	return &responsex, nil
}
func (a *ApiOpaque) List(grpc.ClientStreamingServer[opaquex.LoginRequest, opaquex.LoginResponse]) error {
	return status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (a *ApiOpaque) SingleResp(*opaquex.LoginRequest, grpc.ServerStreamingServer[opaquex.LoginResponse]) error {
	return status.Errorf(codes.Unimplemented, "method SingleResp not implemented")
}
func (a *ApiOpaque) ListResp(grpc.BidiStreamingServer[opaquex.LoginRequest, opaquex.LoginResponse]) error {
	return status.Errorf(codes.Unimplemented, "method ListResp not implemented")
}
